﻿using System;
using System.Collections.Generic;
using System.Diagnostics.Contracts;
using System.Linq;
using System.Text;

namespace RPNCalculator
{
    [ContractClass(typeof(CommandBase))]
    interface ICommand
    {
        //returns true if undostack is null
        //pre: true
        //Post: bool=undostack==null
        bool IsUndoStackNull();

        //returns true if valuestack is null
        //pre: true
        //Post: bool=valuestack==null
        bool IsValueStackNull();
        
        //Executes a task defined by the class
        //pre: valuestack!=null
        //Post: oldValueStack==PreExecutedValueStack
        //post: oldvaluestack!=resultValueStack
        void Execute();
        
        //undoes the state the stack was put in by the command to the state it was in before the execute command was run
        //pre: undostack.count>0
        //post: resultvaluestack==preExecutedValuestack
        void Undo();

        //returns the amount of values in the stack
        //pre: true
        //Post: result==valuestack.count
       int ValueStackCount();

        //returns the amount of undoes available
      //pre: true
      //post: result==undostack.count
      int UndoStackCount();

        //checks if the valuestack still has values
        //pre: valuestack!=null
        //post: result==valuestack.count>0
       bool IsEmpty();
    }

}
